AUTOMAKE_OPTIONS = foreign no-dependencies

pkgincludedir = $(includedir)/tinydom
AM_CFLAGS = -Wall $(LIBEVENT_CFLAGS)

lib_LTLIBRARIES = libtdom.la
noinst_PROGRAMS = tdom_test writer_sample

TDOM_SRCS = tdom-internal.h tdom.c tdom_expat.c tdom_writer.h tdom_writer.c

INCLUDES = -I$(srcdir)/compat

libtdom_la_SOURCES = $(TDOM_SRCS)
libtdom_la_LIBADD = @LTLIBOBJS@

tdom_test_SOURCES = minunit.h tdom_test.c
tdom_test_LDADD = libtdom.la $(LIBEVENT_LIBS) -lexpat

writer_sample_SOURCES = writer_sample.c
writer_sample_LDADD = libtdom.la $(LIBEVENT_LIBS) -lexpat

pkginclude_HEADERS = tdom.h tdom_writer.h

test: tdom_test
	@$(srcdir)/tdom_test

leakcheck: tdom_test
	@valgrind --leak-check=full -v $(srcdir)/tdom_test

gcov: test
	echo $(srcdir)
	lcov -c -o $(srcdir)/tdom_test.gcovinfo -d $(srcdir)
	genhtml -s -f -o $(srcdir)/html $(srcdir)/tdom_test.gcovinfo

verify: test

clean-local:
	-rm -rf $(srcdir)/html

DISTCLEANFILES = *~ *.gcno *.gcda *.gcov *.gcovinfo
CLEANFILES = *.gcno *.gcda *.gcov *.gcovinfo

pkgconfigdir = $(libdir)/pkgconfig
pkgconfig_DATA = tinydom.pc
